import service from ".."
import type { ApiResponse } from "../type"

interface LoginForm {
  username: string
  password: string
}

interface LoginResponse {
  token: string
  message: string
}

export const login = (
  userInfo: LoginForm
): Promise<ApiResponse<LoginResponse>> => {
  return service.post<ApiResponse<LoginResponse>>("/login", userInfo)
}
